package com.hdu.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 菜单实体类
 * </p>
 *
 * @author xiaobai
 * @since 2024-05-21
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("menu")
public class Menu implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.INPUT)
    private String id;

    /**
     * 菜单名称
     */
    private String name;

    /**
     * 父级编号
     */
    private String pid;

    /**
     * 菜单编码
     */
    private String code;

    /**
     * 菜单层次
     */
    private Integer level;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    /**
     * 是否被分配
     */
    @TableField(exist = false)
    private boolean select;

    /**
     * 子菜单
     */
    @TableField(exist = false)
    private List<Menu> children;
}
